When two or more computers are interconnected via data communications network, it becomes feasible to maintain several copies of data; each copy stored as a separate replica. Data replication is a common technique employed in distributed systems to improve the availability and durability of data. There are several reasons why data replication may be employed. For example, at least one copy of the data may be accessible in the case where some of the nodes are not available. Also, data replication helps improve the performance of read requests, because read requests may be distributed between many nodes.
In many data replication applications, replicated copies may be required to behave as a single copy to maintain mutual consistency (e.g., all copies of data converge to the same values and would be identical if all update activities cease). The inherent communication delay between nodes that store and maintain copies of replicated data make it difficult to ensure that all copies are identical at all times when updates are processed in the system.
One common technique used to ensure data durability is to perform synchronous writes. When processing a write request, a node may write the data contained in the write request to durable storage (e.g., disk sub-system) before acknowledging the write request was processed successfully. Even if the node subsequently fails, the data within the write request has been written to disk and can be recovered. However, synchronous writes result in slow performance because the write request is not acknowledged until the node has successfully written the data to durable storage.
One technique commonly used to maximize performance is to perform asynchronous writes. Typically, a node performing asynchronous writes may receive a write request and write the data to an in-memory buffer (e.g., main volatile memory). The node may then acknowledge the write request was successful and subsequently write the data to durable storage. The asynchronous write may ensure that the write request is not slowed by disk I/O performance. Accessing an in-memory buffer is significantly faster than accessing a disk. However, when using asynchronous writes, data may be lost, even after acknowledging the write request was processed successfully. For example, a node may fail after acknowledging the write request but before writing the data to durable storage.